import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useStore  = defineStore('index',  {
  state: () => ({
    userInfo: JSON.parse(localStorage.getItem('userInfo') || '{}'),
    contactInfo: {},
  }),
  actions: {
    updateUserInfo(data?: any) {
      this.userInfo = data || JSON.parse(localStorage.getItem('userInfo') || '{}')
    },
    updateContactInfo(data?: any) {
      this.contactInfo = data
    }
  },
})
